<?php


namespace App\Http\Controllers\Admin;
use App\Http\Controllers\BaseController;
use App\Models\Config;
use Illuminate\Http\Request;

class ConfigController extends BaseController
{

    public function aboutUsInfo(Request $request) {
        $value = Config::where('key', 'about_us')->value( 'value');
        $value = json_decode($value, true);
        return $this->success($value);
    }

    /**
     * 修改
     * @param Request $request
     * @return mixed
     * @throws \Illuminate\Validation\ValidationException
     */
    public function aboutUsStore(Request $request) {
        $input = $request->input();
        $model = Config::where('key', 'about_us' )->first();
        $model->value = json_encode_cn($input);
        $model->save();

        return $this->success([]);
    }

}

